libxl: during domain destruction, do not complain if no devices dir to destroy
authorIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 28 Jan 2011 18:38:26 +0000 (18:38 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Fri, 28 Jan 2011 18:38:26 +0000 (18:38 +0000)
commitefdadb8156974e75bd2aa6eb61a69a4becf84bb0
tree8605b94c741f85e1413a4ac155b7c924c91d1615
parent91e6ad2242cf72683cf832e9c50158539a224dbf
libxl: during domain destruction, do not complain if no devices dir to destroy

Previously calling libxl__devices_destroy on a half-constructed or
half-destroyed domain would sometimes complain along these lines:
  libxl: error: libxl_device.c:327:libxl__devices_destroy /local/domain/29/device is empty
This is (a) not a reasonable thing to complain about and (b) not an
accurate description of all the things that that particular failure of
libxl__xs_directory might mean.

Change the code to check errno, so that if errno==ENOENT we silently
continue, not destroying any devices, and if errno!=ENOENT, properly
log the problem and fail.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/libxl/libxl_device.c